# _*_ coding: utf-8 _*_
__author__ = 'yinlei'
__date__ = '2018-05-18 10:30'

from datetime import datetime

from exts import db


class BaseMode(db.Model):
    __abstract__ = True
    is_delete = db.Column(db.SmallInteger, default=1)
    create_time = db.Column('create_time', db.INTEGER)

    def __init__(self,*args,**kwargs):
        if 'create_time' in kwargs:
            kwargs.popitem('create_time')
        self.create_time = int(datetime.now().timestamp())
        super(BaseMode, self).__init__(*args, **kwargs)
